package cn.source.web.controller.zk;


import cn.source.common.core.controller.BaseController;
import cn.source.common.core.domain.AjaxResult;
import cn.source.zk.domain.entity.*;
import cn.source.zk.service.DimensionTablesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/zk/dimensionTables")
public class DimensionTablesController extends BaseController {

    @Autowired
    private DimensionTablesService dimensionTablesService;

    /**
     * 入网方式
     * @return
     */
    @GetMapping("/connMethod")
    public AjaxResult getConnMethod(){
        List<ConnMethod> list = dimensionTablesService.getConnMethod();
        return AjaxResult.success(list);
    }

    /**
     * 接线方式
     * @return
     */
    @GetMapping("/wiringMethod")
    public AjaxResult getWiringMethod(){
        List<WiringMethod> list = dimensionTablesService.getWiringMethod();
        return AjaxResult.success(list);
    }

    /**
     * 接入方式
     * @return
     */
    @GetMapping("/accessMethod")
    public AjaxResult getAccessMethod(){
        List<AccessMethod> list = dimensionTablesService.getAccessMethod();
        return AjaxResult.success(list);
    }

    /**
     * 通信规约
     * @return
     */
    @GetMapping("/communicationProtocol")
    public AjaxResult getCommunicationProtocol(){
        List<CommunicationProtocol> list = dimensionTablesService.getCommunicationProtocol();
        return AjaxResult.success(list);
    }

    /**
     * 额定电压
     * @return
     */
    @GetMapping("/ratedVol")
    public AjaxResult getRatedVol(){
        List<RatedVol> list = dimensionTablesService.getRatedVol();
        return AjaxResult.success(list);
    }

    /**
     * 电压等级
     * @return
     */
    @GetMapping("/volLevel")
    public AjaxResult getVolLevel(){
        List<VolLevel> list = dimensionTablesService.getVolLevel();
        return AjaxResult.success(list);
    }

    /**
     * 设备状态
     * @return
     */
    @GetMapping("/deviceStatus")
    public AjaxResult getDeviceStatus(){
        List<DeviceStatus> list = dimensionTablesService.getDeviceStatus();
        return AjaxResult.success(list);
    }

    /**
     * 同步方式
     * @return
     */
    @GetMapping("/timeSyncMethod")
    public AjaxResult getTimeSyncMethod(){
        List<TimeSyncMethod> list = dimensionTablesService.getTimeSyncMethod();
        return AjaxResult.success(list);
    }

}
